<?php

class Emms_Form_Admin_GroupExport extends HTech_Form
{
    var $_primary  = 'GroupId';
    
    public function __construct($group) 
    {
        parent::__construct();        
        
        $this->setName('GroupExport');
                
        $this->setAttrib('title', $this->translate("Group export form"));
        $this->setDescription($this->translate("Select destination bank to complete export"));
                
        $groupId = new Zend_Form_Element_Hidden('GroupId');
        
        $sql = sprintf("select BankId, Name from banks where OfficerUserId = %s and BankId != %s", $group->d->OfficerUserId, $group->d->BankId);
        $bankId = new Zend_Form_Element_Select('BankId');
        $bankId->setLabel("Export to")                
            ->setAttrib('size','10')
            ->addMultiOptions($this->_db->fetchPairs($sql));
                
        $submit = new Zend_Form_Element_Submit('Submit');
        $submit->setLabel("Submit")
            ->addDecorator(new HTech_Form_Decorator_Button(array('type'=>'submit')));
        
        //$this->setDecorators(array(array('ViewScript', array('viewScript' => 'group/_form_export.phtml'))));
        $this->addElements(array($bankId, $groupId, $submit));
    }
} 
        
        